/**
 * SRM529, Div2 - Level1.
 * 
 */

/**
 * @author antonio081014
 * @since Jan 14, 2012, 9:10:53 AM
 */
import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
import java.awt.geom.*;

public class PairingPawns {
    public int savedPawnCount(int[] start) {
        for (int i = start.length - 1; i > 0; i--) {
            start[i - 1] += start[i] / 2;
        }
        return start[0];
    }

    // <%:testing-code%>
}
// Powered by [KawigiEdit] 2.0!
